﻿using MySqlConnector;
using PersonalWebsite.Core.CQRS;
using System.Data;

namespace PersonalWebsite.Application.DBConnectionFactory;

internal sealed class MySqlDBConnectionFactory : IDBConnectionFactory
{
    private readonly string _connectionString;

    public MySqlDBConnectionFactory(string connectionString)
    {
        _connectionString = connectionString;
    }

    public IDbConnection GetDbConnection() =>
         new MySqlConnection(_connectionString);
}
